package kuzha.runtime;

public class KzInt64 extends KzInteger {
	public static KzInt64 valueOf(long num) {
		return new KzInt64(num);
	}
	
	public final long value;
	
	protected KzInt64(long value) {
		this.value = value;
	}
	
	@Override
	public boolean isTrue() {
		return value != 0;
	}
	
	@Override
	public Object toJavaObject() {
		return value;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + (int) (value ^ (value >>> 32));
		return result;
	}
	
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final KzInt64 other = (KzInt64) obj;
		if (value != other.value)
			return false;
		return true;
	}
	
	@Override
	public Number getNumber() { return value; }
	@Override
	public String toString() { return Long.toString(value); }
	@Override
	public String toHexString() { return Long.toHexString(value); }
}
